<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
    <title>菜单列表</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script language="javascript" src="${pageContext.request.contextPath}/script/jquery.js"></script>
    <script language="javascript" src="${pageContext.request.contextPath}/script/pageCommon.js" charset="utf-8"></script>
    <script language="javascript" src="${pageContext.request.contextPath}/script/PageUtils.js" charset="utf-8"></script>
    <script language="javascript" src="${pageContext.request.contextPath}/script/DemoData.js" charset="utf-8"></script>
	<script language="javascript" src="${pageContext.request.contextPath}/script/DataShowManager.js" charset="utf-8"></script>
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/style/blue/pageCommon.css" />
    <script type="text/javascript">
    </script>
</head>
<body>
 
<div id="Title_bar">
    <div id="Title_bar_Head">
        <div id="Title_Head"></div>
        <div id="Title"><!--页面标题-->
            <img border="0" width="13" height="13" src="${pageContext.request.contextPath}/style/images/title_arrow.gif"/> 菜单管理
        </div>
        <div id="Title_End"></div>
    </div>
</div>

<div id="MainArea">
    <table cellspacing="0" cellpadding="0" class="TableStyle">
       
        <!-- 表头-->
        <thead>
            <tr align=center valign=middle id=TableTitle>
            	<td width="150px">菜单名称</td>
				<td width="150px">上级菜单名称</td>
				<td width="150px">菜单图标地址</td>
				<td width="150px">菜单页面链接</td>
				<td width="150px">激活/禁用</td>
				<td>相关操作</td>
            </tr>
        </thead>

		<!--显示数据列表-->
        <tbody id="TableData">
        <c:if test="${pageBean!=null && pageBean.list.size()>0 }">
        <c:forEach items="${pageBean.list }" var="e1">
			<tr class="TableDetail1 template">
				<td>${e1.menuName}&nbsp;</td>  <!--<a href="${pageContext.request.contextPath}/menuPoServlet?did=${e1.menuId}">${e1.menuName}</a>  -->
				<td>${e1.parentName}&nbsp;</td>
				<td>${e1.menuIcon}&nbsp;</td>
				<td>${e1.menuUrl}&nbsp;</td>
				<td>
					<c:choose>
						<c:when test="${e1.isActive==1 }">激活</c:when>
		                <c:otherwise>禁用</c:otherwise>
					</c:choose>&nbsp;
				</td>
				<td><!--  <a onClick="return window.confirm('这将删除所有的下级部门，您确定要删除吗？')" href="#">删除</a> -->
					<c:choose>
						<c:when test="${e1.isActive==1 }"><a href="${pageContext.request.contextPath}/menuPoServlet?id=${e1.menuId}&opr=isActive&pageIndex=${pageBean.pageIndex }">禁用</a></c:when>
		                <c:otherwise><a href="${pageContext.request.contextPath}/menuPoServlet?id=${e1.menuId}&opr=isActive&pageIndex=${pageBean.pageIndex }">激活</a></c:otherwise>
					</c:choose>
					<a href="${pageContext.request.contextPath}/menuPoServlet?opr=update&fromMode=inupdate&id=${e1.menuId}&pageIndex=${pageBean.pageIndex }">修改</a>
					
				</td>
			</tr>
			</c:forEach>
			</c:if>
        </tbody>
    </table>
    <!--分页信息-->
	<div id=PageSelectorBar>
		<div id=PageSelectorMemo>
			页次：${pageBean.pageIndex }/${pageBean.pageCount }页 &nbsp;&nbsp;
			每页显示：${pageBean.pageSize }条 &nbsp;&nbsp;
			总记录数：${pageBean.totalCount }条 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<c:choose>
				<c:when test="${pageBean.pageIndex<=1&&pageBean.pageCount>1 }">
					<label>首页</label>&nbsp;&nbsp;
					<label>上一页</label>&nbsp;&nbsp;
					<a href="${pageContext.request.contextPath}/menuPoServlet?pageIndex=${pageBean.pageIndex+1 }&opr=load" style="cursor: hand;color:blue;">下一页</a>&nbsp;&nbsp;
					<a href="${pageContext.request.contextPath}/menuPoServlet?pageIndex=${pageBean.pageCount }&opr=load" style="cursor: hand;color:blue;">尾页</a>&nbsp;&nbsp;
				</c:when>
				<c:when test="${pageBean.pageIndex<pageBean.pageCount }">
					<a href="${pageContext.request.contextPath}/menuPoServlet?pageIndex=1&opr=load" style="cursor: hand;color:blue;">首页</a> &nbsp;&nbsp;
					<a href="${pageContext.request.contextPath}/menuPoServlet?pageIndex=${pageBean.pageIndex-1 }&opr=load" style="cursor: hand;color:blue;">上一页</a>&nbsp;&nbsp;
					<a href="${pageContext.request.contextPath}/menuPoServlet?pageIndex=${pageBean.pageIndex+1 }&opr=load" style="cursor: hand;color:blue;">下一页</a>&nbsp;&nbsp;
					<a href="${pageContext.request.contextPath}/menuPoServlet?pageIndex=${pageBean.pageCount }&opr=load" style="cursor: hand;color:blue;">尾页</a>&nbsp;&nbsp;
				</c:when>
				<c:when test="${pageBean.pageIndex==pageBean.pageCount&&pageBean.pageCount>1 }">
					<a href="${pageContext.request.contextPath}/menuPoServlet?pageIndex=1&opr=load" style="cursor: hand;color:blue;">首页</a> &nbsp;&nbsp;
					<a href="${pageContext.request.contextPath}/menuPoServlet?pageIndex=${pageBean.pageIndex-1 }&opr=load" style="cursor: hand;color:blue;">上一页</a>&nbsp;&nbsp;
					<label>下一页</label>&nbsp;&nbsp;
					<label>末页</label>&nbsp;&nbsp;
				</c:when>
				<c:otherwise>
					<label>首页</label>&nbsp;&nbsp;
					<label>上一页</label>&nbsp;&nbsp;
					<label>下一页</label>&nbsp;&nbsp;
					<label>末页</label>&nbsp;&nbsp;
				</c:otherwise>
			</c:choose>
			
		</div>
	</div>
    <!-- 其他功能超链接 -->
    <div id="TableTail">
        <div id="TableTail_inside">
            <a href="${pageContext.request.contextPath}/menuPoServlet?opr=add&fromMode=inadd"><img src="${pageContext.request.contextPath}/style/images/createNew.png" /></a>
           <!-- <a href="${pageContext.request.contextPath}/jsp/sys/dept/dept_save.jsp?list=${list }"><img src="${pageContext.request.contextPath}/style/images/createNew.png" /></a>
           -->
        </div>
    </div>
</div>

<!--说明-->	
<div id="Description"> 
	说明：<br />
	1，列表页面只显示一层的（同级的）部门数据，默认显示最顶级的部门列表。<br />
	2，点击部门名称，可以查看此部门相应的下级部门列表。<br />
	3，删除部门时，同时删除此部门的所有下级部门。
</div>

</body>
</html>

